<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue.global.js"></script>
    <style>
        .v-enter-from{
            opacity: 0;
        }
        .v-enter-active{
            transition:opacity 3s ease-out;
        }
        .v-enter-to{
            opacity: 1;
        }
        .v-leave-from{
            opacity: 1;
        }
        .v-leave-active{
            transition:opacity 3s ease-out;
        }
        .v-leave-to{
            opacity: 0;
        }
    </style>
</head>
<body>
<div id="app"></div>
<script>
    const app = Vue.createApp({
        data() {
            return {
                show: false
            }
        },
        methods: {
            handleClick() {
                this.show = !this.show;
            }
        },
        template: `
          <div>
          <transition>
            <div v-show="show">hello world</div>
          </transition>
          <button @click="handleClick">切换</button>
          </div>
        `
    });
    const vm = app.mount("#app");
</script>
</body>
</html>